#ifndef __CPPTUTOROBSERVER_H__
#define __CPPTUTOROBSERVER_H__

//=========================================================
// cppTutorObserver.h
//
// Defines the Observer pattern. The Observer pattern
// defines an one-to-many dependency between a subject
// object and any number of observer objects so that
// when the subject object changes state, all its
// observer objects are notified and updated automatically.
//
// The Observer pattern is also known as Dependents and
// Publish-Subscribe.
//
// The Observer pattern has four classes and they are:
//  Observer
//  Subject
//  ConcreteObserver (child of Observer)
//  ConcreteSubject (child of Subject)
//
// Both Observer and Subject class are generic and they can
// be reused without modification.
//
// However ConcreteObserver and ConcreteSubject contains
// many application specific information. Their class
// framework can be reused with modificaiton.
//
//=========================================================

#include <list>
#include <iostream>
#include <vector>

using namespace std ;

class Subject;

//=========================================================
// Observer class
//
// It defines the interface to attach with an object of
// the type Subject. It's has to be subclassed in order
// to be applied. It defines only the interface type.
//
// The function Update() is declared as virtual function
// and has to be implemented in it's child class. The
// Update() function is used by the Subject type object
// for notifying state change.
//
//=========================================================
class Observer 
{
    public:
        Observer();
       ~Observer();

        //defines the function Update() that interfaces with the Subject class. 
        //This function is called by object of the type Subject. 
        virtual void Update(Subject* theChangeSubject) = 0;
};

#endif //__CPPTUTOROBSERVER_H__

